﻿namespace HRM.CORE.REPORT
{
    using APP.HELPER.Utils.Security;
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptEmployee : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private XRLabel chSex;
        private IContainer components;
        private DetailBand Detail;
        private XRLabel dtBirthday;
        private XRLabel dtIDCardDate;
        private HRM_EMPLOYEE l_Employee;
        private XRLabel lcBirthday;
        private XRLabel lcBirthPlace;
        private XRLabel lcCellPhone;
        private XRLabel lcContactAddress;
        private XRLabel lcDepartment;
        private XRLabel lcEducation;
        private XRLabel lcEmail;
        private XRLabel lcEmployeeName;
        private XRLabel lcEthnic;
        private XRLabel lcIDCard;
        private XRLabel lcIDCardDate;
        private XRLabel lcIDCardPlace;
        private XRLabel lcInformatic;
        private XRLabel lcLanguage;
        private XRLabel lcMainAddress;
        private XRLabel lcPosition;
        private XRLabel lcReligion;
        private XRLabel lcSex;
        private string m_Code;
        private string m_EmployeeCode;
        private int m_Level;
        private PageFooterBand PageFooter;
        private XRPictureBox ptEmployeePhoto;
        private XRPictureBox ptPhoto;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRLabel txtBirthPlace;
        private XRLabel txtCellPhone;
        private XRLabel txtCompany;
        private XRLabel txtContactAddress;
        private XRLabel txtDepartment;
        private XRLabel txtEducation;
        private XRLabel txtEmail;
        private XRLabel txtEmployeeCode;
        private XRLabel txtEmployeeName;
        private XRLabel txtEthnic;
        private XRLabel txtFirstName;
        private XRLabel txtIDCard;
        private XRLabel txtIDCardPlace;
        private XRLabel txtInformatic;
        private XRLabel txtLanguage;
        private XRLabel txtLastName;
        private XRLabel txtMainAddress;
        private XRLabel txtPosition;
        private XRLabel txtReligion;
        private XRLabel xrLabel2;
        private XRLabel xrLabel4;
        private XRLabel xrLabel7;
        private XRTable xrTable3;
        private XRTableCell xrTableCell10;
        private XRTableCell xrTableCell11;
        private XRTableCell xrTableCell12;
        private XRTableCell xrTableCell7;
        private XRTableCell xrTableCell8;
        private XRTableCell xrTableCell9;
        private XRTableRow xrTableRow3;
        private XRTableRow xrTableRow4;

        public rptEmployee()
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
        }

        public rptEmployee(string EmployeeCode)
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.m_EmployeeCode = EmployeeCode;
        }

        public rptEmployee(int Level, string Code)
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
        }

        private void chSex_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                if (Convert.ToBoolean(this.chSex.Text))
                {
                    this.chSex.Text = "Nam";
                }
                else
                {
                    this.chSex.Text = "Nữ";
                }
            }
            catch
            {
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void dtBirthday_BeforePrint(object sender, PrintEventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.txtEmployeeCode.Text);
            this.dtBirthday.Text = hrm_employee.BirthdayDay.ToString() + "/" + hrm_employee.BirthdayMonth.ToString() + "/" + hrm_employee.BirthdayYear.ToString();
        }

        private void dtIDCardDate_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.dtIDCardDate.Text = Convert.ToDateTime(this.dtIDCardDate.Text).ToShortDateString();
            }
            catch
            {
            }
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.ptEmployeePhoto = new XRPictureBox();
            this.lcEmail = new XRLabel();
            this.txtEmail = new XRLabel();
            this.lcCellPhone = new XRLabel();
            this.txtCellPhone = new XRLabel();
            this.dtIDCardDate = new XRLabel();
            this.lcIDCardPlace = new XRLabel();
            this.txtIDCardPlace = new XRLabel();
            this.lcIDCard = new XRLabel();
            this.txtIDCard = new XRLabel();
            this.lcIDCardDate = new XRLabel();
            this.txtPosition = new XRLabel();
            this.lcPosition = new XRLabel();
            this.txtDepartment = new XRLabel();
            this.lcDepartment = new XRLabel();
            this.txtInformatic = new XRLabel();
            this.lcInformatic = new XRLabel();
            this.txtLanguage = new XRLabel();
            this.lcLanguage = new XRLabel();
            this.txtEducation = new XRLabel();
            this.lcEducation = new XRLabel();
            this.lcReligion = new XRLabel();
            this.txtReligion = new XRLabel();
            this.lcEthnic = new XRLabel();
            this.txtEthnic = new XRLabel();
            this.txtContactAddress = new XRLabel();
            this.lcContactAddress = new XRLabel();
            this.txtMainAddress = new XRLabel();
            this.lcMainAddress = new XRLabel();
            this.txtEmployeeCode = new XRLabel();
            this.txtBirthPlace = new XRLabel();
            this.lcBirthPlace = new XRLabel();
            this.dtBirthday = new XRLabel();
            this.lcBirthday = new XRLabel();
            this.lcSex = new XRLabel();
            this.txtLastName = new XRLabel();
            this.txtFirstName = new XRLabel();
            this.txtEmployeeName = new XRLabel();
            this.chSex = new XRLabel();
            this.lcEmployeeName = new XRLabel();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.txtAddress = new XRLabel();
            this.ptPhoto = new XRPictureBox();
            this.xrLabel4 = new XRLabel();
            this.xrTable3 = new XRTable();
            this.xrTableRow3 = new XRTableRow();
            this.xrTableCell7 = new XRTableCell();
            this.xrTableCell8 = new XRTableCell();
            this.xrTableCell9 = new XRTableCell();
            this.xrTableRow4 = new XRTableRow();
            this.xrTableCell10 = new XRTableCell();
            this.xrTableCell11 = new XRTableCell();
            this.xrTableCell12 = new XRTableCell();
            this.xrLabel7 = new XRLabel();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.PageFooter = new PageFooterBand();
            this.xrTable3.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { 
                this.ptEmployeePhoto, this.lcEmail, this.txtEmail, this.lcCellPhone, this.txtCellPhone, this.dtIDCardDate, this.lcIDCardPlace, this.txtIDCardPlace, this.lcIDCard, this.txtIDCard, this.lcIDCardDate, this.txtPosition, this.lcPosition, this.txtDepartment, this.lcDepartment, this.txtInformatic, 
                this.lcInformatic, this.txtLanguage, this.lcLanguage, this.txtEducation, this.lcEducation, this.lcReligion, this.txtReligion, this.lcEthnic, this.txtEthnic, this.txtContactAddress, this.lcContactAddress, this.txtMainAddress, this.lcMainAddress, this.txtEmployeeCode, this.txtBirthPlace, this.lcBirthPlace, 
                this.dtBirthday, this.lcBirthday, this.lcSex, this.txtLastName, this.txtFirstName, this.txtEmployeeName, this.chSex, this.lcEmployeeName, this.txtCompany, this.xrLabel2, this.txtAddress, this.ptPhoto, this.xrLabel4, this.xrTable3, this.xrLabel7
             });
            this.Detail.HeightF = 488f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.ptEmployeePhoto.BorderColor = Color.Gainsboro;
            this.ptEmployeePhoto.Borders = BorderSide.All;
            this.ptEmployeePhoto.LocationFloat = new PointFloat(10.41667f, 125.75f);
            this.ptEmployeePhoto.Name = "ptEmployeePhoto";
            this.ptEmployeePhoto.SizeF = new SizeF(88.54167f, 83.24994f);
            this.ptEmployeePhoto.Sizing = ImageSizeMode.ZoomImage;
            this.ptEmployeePhoto.StylePriority.UseBorderColor = false;
            this.ptEmployeePhoto.StylePriority.UseBorders = false;
            this.lcEmail.LocationFloat = new PointFloat(167.2081f, 236.0418f);
            this.lcEmail.Name = "lcEmail";
            this.lcEmail.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcEmail.SizeF = new SizeF(47.50008f, 17.70831f);
            this.lcEmail.Text = "Email:";
            this.txtEmail.LocationFloat = new PointFloat(219.7081f, 236.0418f);
            this.txtEmail.Name = "txtEmail";
            this.txtEmail.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmail.SizeF = new SizeF(221.5836f, 17.70834f);
            this.lcCellPhone.LocationFloat = new PointFloat(13.04158f, 236.0417f);
            this.lcCellPhone.Name = "lcCellPhone";
            this.lcCellPhone.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcCellPhone.SizeF = new SizeF(57.37497f, 17.70831f);
            this.lcCellPhone.Text = "Số ĐT:";
            this.txtCellPhone.LocationFloat = new PointFloat(74.5416f, 236.0417f);
            this.txtCellPhone.Name = "txtCellPhone";
            this.txtCellPhone.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCellPhone.SizeF = new SizeF(88.16685f, 17.70834f);
            this.dtIDCardDate.LocationFloat = new PointFloat(291.25f, 288.5417f);
            this.dtIDCardDate.Name = "dtIDCardDate";
            this.dtIDCardDate.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.dtIDCardDate.SizeF = new SizeF(120.4999f, 17.70834f);
            this.dtIDCardDate.BeforePrint += new PrintEventHandler(this.dtIDCardDate_BeforePrint);
            this.lcIDCardPlace.LocationFloat = new PointFloat(414.25f, 288.5417f);
            this.lcIDCardPlace.Name = "lcIDCardPlace";
            this.lcIDCardPlace.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcIDCardPlace.SizeF = new SizeF(62.50006f, 17.70831f);
            this.lcIDCardPlace.Text = "Nơi cấp:";
            this.txtIDCardPlace.LocationFloat = new PointFloat(477.75f, 288.5417f);
            this.txtIDCardPlace.Name = "txtIDCardPlace";
            this.txtIDCardPlace.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtIDCardPlace.SizeF = new SizeF(264.6249f, 17.70834f);
            this.lcIDCard.LocationFloat = new PointFloat(12.25001f, 288.5417f);
            this.lcIDCard.Name = "lcIDCard";
            this.lcIDCard.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcIDCard.SizeF = new SizeF(114.4997f, 17.70831f);
            this.lcIDCard.Text = "Số CMND:";
            this.txtIDCard.LocationFloat = new PointFloat(126.75f, 288.5417f);
            this.txtIDCard.Name = "txtIDCard";
            this.txtIDCard.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtIDCard.SizeF = new SizeF(86.58328f, 17.70834f);
            this.lcIDCardDate.LocationFloat = new PointFloat(216.25f, 288.5417f);
            this.lcIDCardDate.Name = "lcIDCardDate";
            this.lcIDCardDate.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcIDCardDate.SizeF = new SizeF(72.54182f, 17.70831f);
            this.lcIDCardDate.Text = "Ng\x00e0y cấp:";
            this.txtPosition.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtPosition.LocationFloat = new PointFloat(395.2086f, 347.0416f);
            this.txtPosition.Name = "txtPosition";
            this.txtPosition.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtPosition.SizeF = new SizeF(347.1663f, 17.70834f);
            this.txtPosition.StylePriority.UseFont = false;
            this.lcPosition.LocationFloat = new PointFloat(315.7086f, 347.0416f);
            this.lcPosition.Name = "lcPosition";
            this.lcPosition.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcPosition.SizeF = new SizeF(75.29176f, 17.70831f);
            this.lcPosition.Text = "Chức vụ:";
            this.txtDepartment.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtDepartment.LocationFloat = new PointFloat(91.91702f, 347.0416f);
            this.txtDepartment.Name = "txtDepartment";
            this.txtDepartment.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtDepartment.SizeF = new SizeF(218.6247f, 17.70834f);
            this.txtDepartment.StylePriority.UseFont = false;
            this.lcDepartment.LocationFloat = new PointFloat(13.62514f, 347.0416f);
            this.lcDepartment.Name = "lcDepartment";
            this.lcDepartment.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcDepartment.SizeF = new SizeF(75.29176f, 17.70831f);
            this.lcDepartment.Text = "Ph\x00f2ng ban:";
            this.txtInformatic.LocationFloat = new PointFloat(477.5831f, 260.7501f);
            this.txtInformatic.Name = "txtInformatic";
            this.txtInformatic.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtInformatic.SizeF = new SizeF(264.7917f, 17.70834f);
            this.lcInformatic.LocationFloat = new PointFloat(418.0831f, 260.7501f);
            this.lcInformatic.Name = "lcInformatic";
            this.lcInformatic.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcInformatic.SizeF = new SizeF(57.37497f, 17.70831f);
            this.lcInformatic.Text = "Tin học:";
            this.txtLanguage.LocationFloat = new PointFloat(292.5832f, 260.75f);
            this.txtLanguage.Name = "txtLanguage";
            this.txtLanguage.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtLanguage.SizeF = new SizeF(120.4999f, 17.70834f);
            this.lcLanguage.LocationFloat = new PointFloat(217.7081f, 260.75f);
            this.lcLanguage.Name = "lcLanguage";
            this.lcLanguage.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcLanguage.SizeF = new SizeF(72.54182f, 17.70831f);
            this.lcLanguage.Text = "Ngoại ngữ:";
            this.txtEducation.LocationFloat = new PointFloat(128.1249f, 260.75f);
            this.txtEducation.Name = "txtEducation";
            this.txtEducation.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEducation.SizeF = new SizeF(86.58328f, 17.70834f);
            this.lcEducation.LocationFloat = new PointFloat(11.62514f, 260.75f);
            this.lcEducation.Name = "lcEducation";
            this.lcEducation.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcEducation.SizeF = new SizeF(114.4997f, 17.70831f);
            this.lcEducation.Text = "Tr\x00ecnh độ văn h\x00f3a:";
            this.lcReligion.LocationFloat = new PointFloat(584.8334f, 236.0418f);
            this.lcReligion.Name = "lcReligion";
            this.lcReligion.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcReligion.SizeF = new SizeF(69.79169f, 17.70831f);
            this.lcReligion.Text = "T\x00f4n gi\x00e1o:";
            this.txtReligion.LocationFloat = new PointFloat(654.7501f, 236.0418f);
            this.txtReligion.Name = "txtReligion";
            this.txtReligion.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtReligion.SizeF = new SizeF(87.49997f, 17.70834f);
            this.lcEthnic.LocationFloat = new PointFloat(451.2917f, 236.0418f);
            this.lcEthnic.Name = "lcEthnic";
            this.lcEthnic.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcEthnic.SizeF = new SizeF(57.37497f, 17.70831f);
            this.lcEthnic.Text = "D\x00e2n tộc:";
            this.txtEthnic.LocationFloat = new PointFloat(508.6668f, 236.0418f);
            this.txtEthnic.Name = "txtEthnic";
            this.txtEthnic.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEthnic.SizeF = new SizeF(76.16663f, 17.70834f);
            this.txtContactAddress.LocationFloat = new PointFloat(178.8333f, 208.9167f);
            this.txtContactAddress.Name = "txtContactAddress";
            this.txtContactAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtContactAddress.SizeF = new SizeF(563.5416f, 17.70833f);
            this.lcContactAddress.LocationFloat = new PointFloat(107.4167f, 208.9167f);
            this.lcContactAddress.Name = "lcContactAddress";
            this.lcContactAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcContactAddress.SizeF = new SizeF(71.4166f, 17.70836f);
            this.lcContactAddress.Text = "Tạm tr\x00fa:";
            this.txtMainAddress.LocationFloat = new PointFloat(178.8333f, 180.9999f);
            this.txtMainAddress.Name = "txtMainAddress";
            this.txtMainAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtMainAddress.SizeF = new SizeF(564.1666f, 17.70833f);
            this.lcMainAddress.LocationFloat = new PointFloat(108.2083f, 180.9999f);
            this.lcMainAddress.Name = "lcMainAddress";
            this.lcMainAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcMainAddress.SizeF = new SizeF(70.62499f, 17.70833f);
            this.lcMainAddress.Text = "Địa chỉ:";
            this.txtEmployeeCode.BorderColor = Color.Black;
            this.txtEmployeeCode.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeCode.LocationFloat = new PointFloat(10.41667f, 208.9999f);
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeCode.SizeF = new SizeF(88.54169f, 17.70834f);
            this.txtEmployeeCode.StylePriority.UseBorderColor = false;
            this.txtEmployeeCode.StylePriority.UseFont = false;
            this.txtEmployeeCode.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode.TextAlignment = TextAlignment.TopCenter;
            this.txtEmployeeCode.BeforePrint += new PrintEventHandler(this.txtEmployeeCode_BeforePrint);
            this.txtBirthPlace.LocationFloat = new PointFloat(463.0834f, 153.2083f);
            this.txtBirthPlace.Name = "txtBirthPlace";
            this.txtBirthPlace.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtBirthPlace.SizeF = new SizeF(279.9165f, 17.70834f);
            this.lcBirthPlace.LocationFloat = new PointFloat(393.5834f, 153.2083f);
            this.lcBirthPlace.Name = "lcBirthPlace";
            this.lcBirthPlace.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcBirthPlace.SizeF = new SizeF(68.83335f, 17.70833f);
            this.lcBirthPlace.Text = "Nơi sinh:";
            this.dtBirthday.LocationFloat = new PointFloat(260.1667f, 153.2083f);
            this.dtBirthday.Name = "dtBirthday";
            this.dtBirthday.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.dtBirthday.SizeF = new SizeF(126.4583f, 17.70834f);
            this.dtBirthday.BeforePrint += new PrintEventHandler(this.dtBirthday_BeforePrint);
            this.lcBirthday.LocationFloat = new PointFloat(108.2083f, 153.2083f);
            this.lcBirthday.Name = "lcBirthday";
            this.lcBirthday.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcBirthday.SizeF = new SizeF(151.9584f, 17.70834f);
            this.lcBirthday.Text = "Ng\x00e0y, th\x00e1ng, năm sinh:";
            this.lcSex.LocationFloat = new PointFloat(360.4167f, 124.6666f);
            this.lcSex.Name = "lcSex";
            this.lcSex.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcSex.SizeF = new SizeF(68.83335f, 17.70833f);
            this.lcSex.Text = "Giới t\x00ednh:";
            this.txtLastName.LocationFloat = new PointFloat(654.7501f, 124.6666f);
            this.txtLastName.Name = "txtLastName";
            this.txtLastName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtLastName.SizeF = new SizeF(62.50003f, 17.70833f);
            this.txtLastName.Visible = false;
            this.txtFirstName.LocationFloat = new PointFloat(546.3333f, 124.6666f);
            this.txtFirstName.Name = "txtFirstName";
            this.txtFirstName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtFirstName.SizeF = new SizeF(108.4167f, 17.70833f);
            this.txtFirstName.Visible = false;
            this.txtEmployeeName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeName.LocationFloat = new PointFloat(178.8333f, 124.6666f);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeName.SizeF = new SizeF(170.9167f, 17.70833f);
            this.txtEmployeeName.StylePriority.UseFont = false;
            this.txtEmployeeName.BeforePrint += new PrintEventHandler(this.txtEmployeeName_BeforePrint);
            this.chSex.LocationFloat = new PointFloat(429.25f, 124.6666f);
            this.chSex.Name = "chSex";
            this.chSex.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.chSex.SizeF = new SizeF(100f, 17.70833f);
            this.chSex.BeforePrint += new PrintEventHandler(this.chSex_BeforePrint);
            this.lcEmployeeName.LocationFloat = new PointFloat(107.4167f, 124.6666f);
            this.lcEmployeeName.Name = "lcEmployeeName";
            this.lcEmployeeName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.lcEmployeeName.SizeF = new SizeF(68.83335f, 17.70833f);
            this.lcEmployeeName.Text = "Họ v\x00e0 t\x00ean:";
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(93.91676f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(648.3333f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.Text = "txtCompany";
            this.xrLabel2.LocationFloat = new PointFloat(93.91676f, 31.70837f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(52.79146f, 17.70833f);
            this.xrLabel2.Text = "Địa Chỉ:";
            this.txtAddress.LocationFloat = new PointFloat(146.7082f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(595.5417f, 17.70833f);
            this.txtAddress.Text = "txtAddress";
            this.ptPhoto.LocationFloat = new PointFloat(2.375f, 4.999987f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.xrLabel4.Font = new Font("Times New Roman", 16f, FontStyle.Bold);
            this.xrLabel4.LocationFloat = new PointFloat(0.375f, 69.54163f);
            this.xrLabel4.Name = "xrLabel4";
            this.xrLabel4.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel4.SizeF = new SizeF(743f, 30.25002f);
            this.xrLabel4.StylePriority.UseFont = false;
            this.xrLabel4.StylePriority.UseTextAlignment = false;
            this.xrLabel4.Text = "PHIẾU TH\x00d4NG TIN NH\x00c2N VI\x00caN";
            this.xrLabel4.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTable3.LocationFloat = new PointFloat(0f, 385.5f);
            this.xrTable3.Name = "xrTable3";
            this.xrTable3.Rows.AddRange(new XRTableRow[] { this.xrTableRow3, this.xrTableRow4 });
            this.xrTable3.SizeF = new SizeF(743f, 62.5f);
            this.xrTableRow3.Cells.AddRange(new XRTableCell[] { this.xrTableCell7, this.xrTableCell8, this.xrTableCell9 });
            this.xrTableRow3.Name = "xrTableRow3";
            this.xrTableRow3.Weight = 1.0;
            this.xrTableCell7.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell7.Name = "xrTableCell7";
            this.xrTableCell7.StylePriority.UseFont = false;
            this.xrTableCell7.StylePriority.UseTextAlignment = false;
            this.xrTableCell7.Text = "Người lập phiếu";
            this.xrTableCell7.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell7.Weight = 1.0;
            this.xrTableCell8.Name = "xrTableCell8";
            this.xrTableCell8.Weight = 1.0;
            this.xrTableCell9.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell9.Name = "xrTableCell9";
            this.xrTableCell9.StylePriority.UseFont = false;
            this.xrTableCell9.StylePriority.UseTextAlignment = false;
            this.xrTableCell9.Text = "Gi\x00e1m đốc";
            this.xrTableCell9.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell9.Weight = 1.0;
            this.xrTableRow4.Cells.AddRange(new XRTableCell[] { this.xrTableCell10, this.xrTableCell11, this.xrTableCell12 });
            this.xrTableRow4.Name = "xrTableRow4";
            this.xrTableRow4.Weight = 1.0;
            this.xrTableCell10.Font = new Font("Times New Roman", 9.75f, FontStyle.Italic);
            this.xrTableCell10.Name = "xrTableCell10";
            this.xrTableCell10.StylePriority.UseFont = false;
            this.xrTableCell10.StylePriority.UseTextAlignment = false;
            this.xrTableCell10.Text = "(K\x00fd v\x00e0 ghi r\x00f5 họ t\x00ean)";
            this.xrTableCell10.TextAlignment = TextAlignment.TopCenter;
            this.xrTableCell10.Weight = 1.0;
            this.xrTableCell11.Name = "xrTableCell11";
            this.xrTableCell11.Weight = 1.0;
            this.xrTableCell12.Font = new Font("Times New Roman", 9.75f, FontStyle.Italic);
            this.xrTableCell12.Name = "xrTableCell12";
            this.xrTableCell12.StylePriority.UseFont = false;
            this.xrTableCell12.StylePriority.UseTextAlignment = false;
            this.xrTableCell12.Text = "(K\x00fd v\x00e0 ghi r\x00f5 họ t\x00ean)";
            this.xrTableCell12.TextAlignment = TextAlignment.TopCenter;
            this.xrTableCell12.Weight = 1.0;
            this.xrLabel7.ForeColor = Color.Silver;
            this.xrLabel7.LocationFloat = new PointFloat(9.999998f, 159.2083f);
            this.xrLabel7.Name = "xrLabel7";
            this.xrLabel7.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel7.SizeF = new SizeF(88.95835f, 17.70833f);
            this.xrLabel7.StylePriority.UseForeColor = false;
            this.xrLabel7.StylePriority.UseTextAlignment = false;
            this.xrLabel7.Text = "Ảnh";
            this.xrLabel7.TextAlignment = TextAlignment.MiddleCenter;
            this.TopMargin.HeightF = 20f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 20f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.PageFooter.HeightF = 0f;
            this.PageFooter.Name = "PageFooter";
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.PageFooter });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Landscape = true;
            base.Margins = new Margins(0x2d, 0x26, 20, 20);
            base.PageHeight = 0x247;
            base.PageWidth = 0x33b;
            base.PaperKind = PaperKind.A5;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.xrTable3.EndInit();
            this.EndInit();
        }

        private void LoadAllData()
        {
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_Employee.GetListCurrentNow(this.m_Level, this.m_Code, 1);
            set.Tables.Add(table);
            base.DataSource = set;
            this.ptEmployeePhoto.DataBindings.Add("Image", base.DataSource, "Photo");
            this.txtEmployeeCode.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtFirstName.DataBindings.Add("Text", base.DataSource, "FirstName");
            this.txtLastName.DataBindings.Add("Text", base.DataSource, "LastName");
            this.chSex.DataBindings.Add("Text", base.DataSource, "Sex");
            this.txtBirthPlace.DataBindings.Add("Text", base.DataSource, "BirthPlace");
            this.txtMainAddress.DataBindings.Add("Text", base.DataSource, "MainAddress");
            this.txtContactAddress.DataBindings.Add("Text", base.DataSource, "ContactAddress");
            this.txtCellPhone.DataBindings.Add("Text", base.DataSource, "CellPhone");
            this.txtEmail.DataBindings.Add("Text", base.DataSource, "Email");
            this.txtEthnic.DataBindings.Add("Text", base.DataSource, "Ethnic");
            this.txtReligion.DataBindings.Add("Text", base.DataSource, "Religion");
            this.txtEducation.DataBindings.Add("Text", base.DataSource, "Education");
            this.txtLanguage.DataBindings.Add("Text", base.DataSource, "Language");
            this.txtInformatic.DataBindings.Add("Text", base.DataSource, "Informatic");
            this.txtDepartment.DataBindings.Add("Text", base.DataSource, "DepartmentName");
            this.txtPosition.DataBindings.Add("Text", base.DataSource, "Position");
            this.txtIDCard.DataBindings.Add("Text", base.DataSource, "IDCard");
            this.dtIDCardDate.DataBindings.Add("Text", base.DataSource, "IDCardDate");
            this.txtIDCardPlace.DataBindings.Add("Text", base.DataSource, "IDCardPlace");
        }

        private void LoadData()
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.ptEmployeePhoto.Image = hrm_employee.Photo;
            this.txtEmployeeCode.Text = hrm_employee.EmployeeCode;
            this.txtFirstName.Text = hrm_employee.FirstName;
            this.txtLastName.Text = hrm_employee.LastName;
            this.chSex.Text = hrm_employee.Sex.ToString();
            this.dtBirthday.Text = hrm_employee.BirthdayDay.ToString() + "/" + hrm_employee.BirthdayMonth.ToString() + "/" + hrm_employee.BirthdayYear.ToString();
            this.txtBirthPlace.Text = hrm_employee.BirthPlace;
            this.txtMainAddress.Text = hrm_employee.MainAddress;
            this.txtContactAddress.Text = hrm_employee.ContactAddress;
            this.txtCellPhone.Text = hrm_employee.CellPhone;
            this.txtEmail.Text = hrm_employee.Email;
            this.txtEthnic.Text = hrm_employee.Ethnic;
            this.txtReligion.Text = hrm_employee.Religion;
            this.txtEducation.Text = hrm_employee.Education;
            this.txtLanguage.Text = hrm_employee.Language;
            this.txtInformatic.Text = hrm_employee.Informatic;
            this.txtDepartment.Text = hrm_employee.DepartmentName;
            this.txtPosition.Text = hrm_employee.Position;
            this.txtIDCard.Text = hrm_employee.IDCard;
            this.dtIDCardDate.Text = hrm_employee.IDCardDate.ToString();
            this.txtIDCardPlace.Text = hrm_employee.IDCardPlace;
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            if (this.m_EmployeeCode == "")
            {
                this.LoadAllData();
            }
            else
            {
                this.LoadData();
            }
            ////if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.ptPhoto.Image = null;//MyInfo.Photo;
            }
        }

        private void txtEmployeeCode_BeforePrint(object sender, PrintEventArgs e)
        {
        }

        private void txtEmployeeName_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtEmployeeName.Text = (this.txtFirstName.Text + " " + this.txtLastName.Text).ToUpper();
        }
    }
}

